<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:ft="https://github.com/OpenType/fonttest"
      xmlns:xlink="http://www.w3.org/1999/xlink">
<body>
<h3 id="MORX-34">MORX-34: Inserting a Billion Laughs</h3>

<div class="desc">
  The <a href="../fonts/TestMORXThirtyfour.ttf">font</a> for this
  test case is an AAT version of the
  <a href="https://en.wikipedia.org/wiki/Billion_laughs_attack">Billion
  laughs attack</a>. It contains
  an <a href="https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6morx.html"
  >AAT Extended Glyph Metamorphosis Table</a> with nine
  identical <em>Glyph Insertion Subtables</em> whose embedded
  finite-state machine inserts the
  string <em>hahahahahahahahahaha</em> for every <em>a</em> in the
  input string.  If the input is “ha” (one single laugh), the first
  subtable rewrites it to 10 laughs. The second subtable rewrites 10
  to 100 laughs; the third goes from 100 to 1000; the fourth from 1000
  to 10,000.  After executing the ninth subtable, the final result
  will be a billion laughs, but this will take a very long time (and
  large amounts of memory) to compute. Your implementation should
  neither crash nor hang under attack. See also
  <a href="https://github.com/foliojs/fontkit/issues/174">fontkit bug 174</a>.
</div>

<table>
  <tr>
    <th>Expected</th>
    <td class="expected-no-crash" ft:id="MORX-34/1" ft:render="ha"
        ft:font="TestMORXThirtyfour.ttf">Shouldn’t crash</td>
  </tr>
  <tr>
    <th class="conformance-header">Conformance</th>
    <td class="conformance" ft:id="MORX-34/1"/>
  </tr>
</table>
</body>
</html>
